﻿using OnlineMealOrdering.Domain.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OnlineMealOrdering.Domain
{
    /// <summary>
    /// 店铺公告
    /// </summary>
    public class NoticeEntity : AuditableEntity
    {
        public string Title { get; set; }

        public string Content { get; set; }

        public bool Enable { get; set; }

        public int SortNo { get; set; }

        public string Type { get; set; }

        public static NoticeEntity Create(string type,string title, string content="欢迎光临本店铺！", int sortNo=0)
        {
            var entity = new NoticeEntity();
            entity.Type = type;
            entity.Title = title;
            entity.Content = content;
            entity.SortNo = sortNo;

            return entity;
        }

        public void Update(string type, string title, string content, int sortNo = 0, bool enable = true)
        {
            Type = type;
            Title = title;
            Content = content;
            SortNo = sortNo;
            Enable = enable;
        }
    }
}
